{$taxonomy}_{$field}
Filter HookDescription
Filters the taxonomy field sanitized for display. The dynamic portions of the filter name, `$taxonomy`, and `$field`, refer to the taxonomy slug and taxonomy field, respectively.Hook Information
File Location |
wp-includes/taxonomy.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1908 |
Hook Parameters
Type | Name | Description |
---|---|---|
mixed
|
$value
|
Value of the taxonomy field. |
int
|
$term_id
|
Term ID. |
string
|
$context
|
Context to retrieve the taxonomy field value. |
Usage Examples
Basic Usage
<?php
// Hook into {$taxonomy}_{$field}
add_filter('{$taxonomy}_{$field}', 'my_custom_filter', 10, 3);
function my_custom_filter($value, $term_id, $context) {
// Your custom filtering logic here
return $value;
}
Source Code Context
wp-includes/taxonomy.php:1908
- How this hook is used in WordPress core
<?php
1903 *
1904 * @param mixed $value Value of the taxonomy field.
1905 * @param int $term_id Term ID.
1906 * @param string $context Context to retrieve the taxonomy field value.
1907 */
1908 $value = apply_filters( "{$taxonomy}_{$field}", $value, $term_id, $context );
1909 }
1910
1911 if ( 'attribute' === $context ) {
1912 $value = esc_attr( $value );
1913 } elseif ( 'js' === $context ) {
PHP Documentation
<?php
/**
* Filters the taxonomy field sanitized for display.
*
* The dynamic portions of the filter name, `$taxonomy`, and `$field`, refer
* to the taxonomy slug and taxonomy field, respectively.
*
* @since 2.3.0
*
* @param mixed $value Value of the taxonomy field.
* @param int $term_id Term ID.
* @param string $context Context to retrieve the taxonomy field value.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/taxonomy.php
Related Hooks
Related hooks will be displayed here in future updates.